<%@ page import="com.google.inject.Injector"%><%@ page import="org.smth.searcher.Starter"%><%@ page import="org.smth.searcher.persistence.DataService"%><%@ page import="org.smth.searcher.pojos.OnePost"%><%@ page import="java.util.List"%><%!
    private Injector injector= Starter.getInstance().getInjector();
    private DataService service=injector.getInstance(DataService.class);
    private String encode(String s) {
        if(s!=null) {
            s=s.replaceAll("<","&lt;").replaceAll(">","&gt;");
        }
        return s;
    }
%><%@ page contentType="text/html;charset=GB18030" language="java" %><%
    Integer id;
    try {
        id=Integer.parseInt(request.getParameter("id"));
    } catch (Throwable t) {
        id=null;
    }
    OnePost post=null;
    if(id!=null) {
        List<OnePost> list=service.getPostsByIds(id);
        if(list!=null && list.size()>0) {
            post=list.get(0);
        }
    }
%><html>
  <head>
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma"  content="No-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<title><%=post==null?"":encode(post.getTitle())%></title>
  </head>
  <body>
<pre>
<%=post==null?"":encode(post.getContent())%>
</pre>
  </body>
</html>